/**
 * 
 */
package ch.unizh.ifi.ailab.gui;

import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;

import ch.unizh.ifi.ailab.config.ProgramSettings;



/**
 * @author hans jaeckle jaeckle@gmail.com
 * 
 */
public class AboutDialog extends JDialog {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;

	private JLabel line1 = null;

	private JLabel line2 = null;

	private JLabel line3 = null;

	private JLabel line4 = null;

	private JLabel line5 = null;

	private JLabel line6 = null;

	private JLabel line7 = null;

	private JLabel line8 = null;

	private JButton jButton = null;

	/**
	 * @param owner
	 */
	public AboutDialog(Frame owner) {
		super(owner);
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(300, 200);
		this.setTitle("Null15 AI Control - About");
		this.setContentPane(getJContentPane());
		this.setVisible(true);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
			gridBagConstraints7.gridx = 0;
			gridBagConstraints7.gridy = 8;
			GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
			gridBagConstraints6.gridx = 0;
			gridBagConstraints6.gridy = 7;
			line8 = new JLabel();
			line8.setText("   ");
			GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
			gridBagConstraints5.gridx = 0;
			gridBagConstraints5.gridy = 6;
			line7 = new JLabel();
			line7.setText("All rights reserved.");
			GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
			gridBagConstraints4.gridx = 0;
			gridBagConstraints4.gridy = 5;
			line6 = new JLabel();
			line6.setText("   ");
			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
			gridBagConstraints3.gridx = 0;
			gridBagConstraints3.gridy = 4;
			line5 = new JLabel();
			line5.setText("www.015.ch");
			GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
			gridBagConstraints2.gridx = 0;
			gridBagConstraints2.gridy = 3;
			line4 = new JLabel();
			line4.setText("Project 015, University of Zurich");
			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
			gridBagConstraints1.gridx = 0;
			gridBagConstraints1.gridy = 2;
			line3 = new JLabel();
			line3.setText("By Hans Jaeckle");
			GridBagConstraints gridBagConstraints = new GridBagConstraints();
			gridBagConstraints.gridx = 0;
			gridBagConstraints.gridy = 1;
			line2 = new JLabel();
			line2.setText("Version "+ ProgramSettings.getProgramSettings().getProperty("version"));
			line1 = new JLabel();
			line1.setText("Null15 AI Control");
			jContentPane = new JPanel();
			jContentPane.setLayout(new GridBagLayout());
			jContentPane.add(line1, new GridBagConstraints());
			jContentPane.add(line2, gridBagConstraints);
			jContentPane.add(line3, gridBagConstraints1);
			jContentPane.add(line4, gridBagConstraints2);
			jContentPane.add(line5, gridBagConstraints3);
			jContentPane.add(line6, gridBagConstraints4);
			jContentPane.add(line7, gridBagConstraints5);
			jContentPane.add(line8, gridBagConstraints6);
			jContentPane.add(getJButton(), gridBagConstraints7);
		}
		return jContentPane;
	}
	
	private void close(){
		this.dispose();
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setText("OK");
			jButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					close();
				}
			});
		}
		return jButton;
	}

}
